#include"Heap.h"
int main()
{
	/*HP hpp;
	HPInit(&hpp);
	HPPush(&hpp, 9);
	HPPush(&hpp, 8);
	HPPush(&hpp, 5);
	HPPush(&hpp, 6);
	HPPush(&hpp, 7);
	HPPush(&hpp, 4);
	while (HPEmpty(&hpp))
	{
		printf("%d ", HPTop(&hpp));
		HPPop(&hpp);
	}
	HPDestory(&hpp);*/
	int arr[9] = { 9,8,5,7,6,7,2,6,4 };
	int size = sizeof(arr) / sizeof(arr[0]);
	int i = 0;
	for (i = 0; i < size; i++)
	{
		AdjustUp(arr, i);
	}
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
	while (size)
	{
		Swap(&arr[0], &arr[size - 1]);
		size--;
		AdjustDown(arr, size, 0);

	}
	int j = 0; 
	for (j = 0; j < 9; j++)
	{
		printf("%d ", arr[j]);
	}
	return 0;
}

